<?php 
class generalFunctions{
	function xuatds($mang,$ten,$nameall)
	{
		$kq="<select style='width:270px;height:24px;' name='".$ten."'>";
			$kq.="<optgroup ><option value='ALL'>".$nameall."</option></optgroup>";
			foreach ($mang as $khoa=>$giatri)
			{
				$kq.="<optgroup label='".$khoa."'>";
					foreach ($giatri as $hienthi)
					{
						$kq.="<option value='".$hienthi[0]."'";
						if ($_REQUEST["$ten"]==$hienthi[0])
							 $kq.="selected='selected' >".$hienthi[1]."</option>";
						else
							$kq.="'>".$hienthi[1]."</option>";
					}
				$kq.="</optgroup>";
			}
		$kq.="</select>";
		return $kq;
	}
	
	function loadContent7($l_vacationform,$l_content,$l_branch,$l_office,$l_LocationLeave,$l_name,$l_TypeLeave,$l_time,$l_Reason){
		$kq ='<table width="100%" border="1" cellspacing="0"><tr><td height="67" colspan="6" align="center" valign="middle" bgcolor="#EEEEEE">'.$l_vacationform.'</td></tr><tr><td width="115" height="172" align="center" valign="middle" bgcolor="#EEEEEE">'.$l_content.'</td><td colspan="5">&nbsp;</td></tr><tr><td height="38" align="center" valign="middle" bgcolor="#EEEEEE">'.$l_branch.'</td><td width="321">&nbsp;</td><td colspan="2" align="center" valign="middle" bgcolor="#EEEEEE">'.$l_office.'</td><td colspan="2">&nbsp;</td></tr><tr><td height="38" align="center" valign="middle" bgcolor="#EEEEEE">'.$l_LocationLeave.'</td><td>&nbsp;</td><td colspan="2" align="center" valign="middle" bgcolor="#EEEEEE">'.$l_name.'</td><td colspan="2" width="250">&nbsp;</td></tr><tr><td height="38" align="center" valign="middle" bgcolor="#EEEEEE">'.$l_TypeLeave.'</td><td colspan="6">&nbsp;</td></tr><tr><td height="38" align="center" valign="middle" bgcolor="#EEEEEE">'.$l_time.'</td><td colspan="6">&nbsp;</td></tr><tr><td height="38" align="center" valign="middle" bgcolor="#EEEEEE">'.$l_Reason.'</td><td colspan="6">&nbsp;</td></tr></table>';
		return $kq;
	}
	
	function listDepartment($lang){
		$sql="select department_lang.IDDepartment,department_lang.DepartmentName from department_lang where LangID='".$lang."'";
		return $sql;
	}
	
	function listCustomer($danhsach,$sort){
		$sql="select ".$danhsach." from ac_customer".$sort;
		return $sql;
	}
	
	function listEmployee($lang){
		$sql="select department.IDDepartment, department_lang.DepartmentName from department, department_lang where department.IDDepartment = department_lang.IDDepartment and department_lang.LangID='".$lang."'";
		return $sql;
	}
	
	function listTax($lang){
		$sql="select ac_tax.TaxID,ac_tax_lang.TaxName from ac_tax,ac_tax_lang where ac_tax.TaxID = ac_tax_lang.TaxID and ac_tax_lang.LangID = '".$lang."'";
		return $sql;
	}
	
}

?>